<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/ProdType.js此处编写
 -->
<template>
  <div>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormFileds="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormFileds="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
  </div>
</template>

<script>
import extend from "@/extension/mall/ProdType.js";
import ViewGrid from "@/components/basic/ViewGrid.vue";
var vueParam = {
  components: {
    ViewGrid
  },
  data () {
    return {
      table: {
        key: 'id',
        footer: "Foots",
        cnName: '类型配置',
        name: 'ProdType',
        url: "/ProdType/",
        sortName: "createDate"
      },
      extend: extend,
      editFormFields: { "typeName": "", "typeCode": "", "parentID": [], "attributes": [], "uiType": "", "sort": "", "roleId": [], "black_ico": [], "color_ico": [], "creator": "", "createID": "", "createDate": "", "modifier": "", "modifyID": "", "modifyDate": "", "merchantCode": "", "merchantName": "" },
      editFormOptions: [[{ "title": "类型名称", "required": true, "field": "typeName", "type": "text" },
      { "title": "类型编码", "required": true, "field": "typeCode", "type": "text" },
      { "title": "父级", "required": true, "field": "parentID", "type": "cascader", "dataKey": "type_trees", "data": [] }],
      [{ "dataKey": "mall_type", "data": [], "title": "属性", "required": true, "field": "attributes", "colSize": 12, "type": "checkbox" }],
      [{ "dataKey": "uiType", "data": [], "title": "ui类型", "required": true, "field": "uiType", "type": "select" },
      { "title": "排序", "field": "sort", "type": "number" }],
      [{ "dataKey": "Merchants", "data": [], "title": "商户编码", "field": "roleId", "type": "selectList", "colSize": 12, }],
      [{ "title": "黑白图", "maxSize": 1, "required": true, "field": "black_ico", "type": "imgupgrade" },
      { "title": "彩图", "maxSize": 1, "required": true, "field": "color_ico", "type": "imgupgrade" }]],
      searchFormFields: { "typeName": "" },
      searchFormOptions: [[{ "title": "产品类型名称", "field": "typeName", "type": "like" }]],
      columns: [{ field: 'typeName', title: '产品类型名称', type: 'string', width: 220, require: true, align: 'left', sortable: true },
      { field: 'typeCode', title: '产品类型编码', type: 'string', width: 220, hidden: true, require: true, align: 'left' },
      { field: 'parentID', title: '父级', type: 'int', width: 120, hidden: true, require: true, align: 'left' },
      { field: 'parentName', title: '父级类型', type: 'string', width: 120, require: true, align: 'left' },
      { field: 'uiType', title: 'ui类型', type: 'string', bind: { key: 'uiType', data: [] }, width: 120, hidden: true, require: true, align: 'left' },
      { field: 'attributes', title: '属性', type: 'string', bind: { key: 'mall_type', data: [] }, width: 220, align: 'left' },
      { field: 'uiTypeName', title: 'ui类型名称', type: 'string', width: 120, align: 'left' },
      { field: 'black_ico', title: '黑白图', type: 'string', width: 120, require: true, align: 'left' },
      { field: 'color_ico', title: '彩图', type: 'string', width: 120, require: true, align: 'left' },
      { field: 'sort', title: '排序', type: 'int', width: 120, hidden: true, align: 'left' },
      { field: 'merchantName', title: '商户名称', type: 'string', width: 120, hidden: true, align: 'left' },
      { field: 'merchantCode', title: '商户编码', type: 'string', bind: { key: 'Merchants', data: [] }, width: 120, hidden: true, align: 'left' },
      { field: 'creator', title: '创建人', type: 'string', width: 90, align: 'left' },
      { field: 'createDate', title: '创建时间', type: 'datetime', width: 220, align: 'left', sortable: true },
      { field: 'createID', title: '创建人ID', type: 'int', width: 90, hidden: true, align: 'left' },
      { field: 'modifier', title: '修改人', type: 'string', width: 90, align: 'left' },
      { field: 'modifyDate', title: '修改时间', type: 'datetime', width: 220, align: 'left', sortable: true },
      { field: 'modifyID', title: '修改人ID', type: 'int', width: 90, hidden: true, align: 'left' },
      { field: 'id', title: '主键', type: 'int', width: 90, hidden: true, readonly: true, require: true, align: 'left' },
      { field: 'isAvailable', title: '是否可用', type: 'sbyte', width: 90, hidden: true, align: 'left' },
      { field: 'isShow', title: '是否展示', type: 'int', width: 120, hidden: true, align: 'left' },
      { field: 'attributeName', title: '属性名称', type: 'string', width: 120, hidden: true, align: 'left' },
      { field: 'isDelete', title: '是否删除', type: 'int', width: 120, hidden: true, require: true, align: 'left' },
      { field: 'roleId', title: '分销商编码', type: 'string', width: 120, hidden: true, align: 'left' }],
      detail: {
        cnName: "#detailCnName",
        columns: [],
        sortName: "",
        key: ""
      }
    };
  }
};
export default vueParam;
</script>
